/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.util.List;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import pojo.Hinhthucthanhtoan;
import util.HibernateUtil;

/**
 *
 * @author HoaDinhGiang
 */
public class hinhthucthanhtoanDAO {
    public static List<Hinhthucthanhtoan> layDanhSachHTTT(){
        List<Hinhthucthanhtoan> ds = null;
        Session session = HibernateUtil.getSessionFactory().openSession();
        try{
            String hql = "select kv from Hinhthucthanhtoan kv";
            Query query = session.createQuery(hql);
            ds = query.list();
        }catch(HibernateException ex){
            //Log the exception
            System.err.println(ex);
        }finally{
            session.close();
        }
        return ds;
    }
}
